package com.mbigger.synchronize;

/**
 * 可重入粒度测试，递归调用本方法
 *
 * @author mbigg
 *
 */
public class SynchronizedOtherMethod11 {

    int a = 0;

    public static void main(String[] args) {
        SynchronizedOtherMethod11 instance = new SynchronizedOtherMethod11();
        instance.method1();
    }

    private synchronized void method1() {
        System.err.println("这是method1，a=" + a);
        if (a == 0) {
            a++;
            method1();
        }
    }
}
